iSCSI stands for "Internet SCSI" and is a standard that allows for using the SCSI[11] protocol over Internet (TCP/IP) connections. Especially with the advent of Gigabit Ethernet, it has become affordable to attach iSCSI storage servers simply as remote hard disks to a computer network. In iSCSI terminology, the server providing storage resources is called an "iSCSI target", while the client connecting to the server and accessing its resources is called "iSCSI initiator".
VirtualBox can transparently present iSCSI remote storage to a virtual machine as a virtual hard disk. The guest operating system will not see any difference between a virtual disk image (VDI file) and an iSCSI target. To achieve this, VirtualBox has an integrated iSCSI initiator.
VirtualBox's iSCSI support has been developed according to the iSCSI
standard and should work with all standard-conforming iSCSI targets. To
use an iSCSI target with VirtualBox, you must first register it as a
virtual hard disk with VBoxManage
; see
Sectioná8.16, “VBoxManage addiscsidisk”. The target will show up in the
list of disk images, as described in Sectioná3.5, “The Virtual Disk Manager”, and can thus
be attached to one of the VM's three hard disk slots the usual way.
As opposed to the VDI files described previously, the type of iSCSI targets cannot be "normal" or "immutable", but will always be set to "write through". This means that their state is not saved or reverted with snapshots.
As an experimental feature, VirtualBox allows for accessing an iSCSI target running in a virtual machine which is configured for using Internal Networking mode (as described in Sectioná6.10, “Internal networking”). The setup of the virtual machine which uses such an iSCSI target is done as described above. The only difference is that the IP address of the target must be specified as a numeric IP address.
The IP stack accessing Internal Networking must be configured in the virtual machine which accesses the iSCSI target. A free static IP and a MAC address not used by other virtual machines must be chosen. In the example below, adapt the name of the virtual machine, the MAC address, the IP configuration and the Internal Networking name ('MyIntNet') according to your needs. The following 7 commands must be issued:
VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/Trusted 1 VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/Config/MAC 08:00:27:01:02:0f VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/Config/IP 10.0.99.1 VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/Config/Netmask 255.255.255.0 VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/LUN#0/Driver IntNet VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/LUN#0/Config/Network MyIntNet VBoxManage setextradata VMNAME VBoxInternal/Devices/IntNetIP/0/LUN#0/Config/IsService 1
Finally the iSCSI TCP transport driver needs to be instructed to use the IP stack for Internal Networking instead of the normal host IP stack:
VBoxManage setextradata VMNAME VBoxInternal/Devices/piix3ide/0/LUN#0/AttachedDriver/AttachedDriver/Config/HostIPStack 0
The virtual machine with the iSCSI target should be started before the VM using it is powered on. If a virtual machine using an iSCSI disk is started without having the iSCSI target powered up, it can take up to 200 seconds to detect this situation. The VM will fail to power up.
[11] SCSI, in turn, is the "Small Computer System Interface" and is an established industry standard for data transfer between devices, notably storage devices. Established as early as 1986, SCSI is still used for connecting hard disks and tape devices even today. Especially in the PC market, however, it competed with other data transfer standards such as IDE. It is still in common use in workstations and servers.